<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>欢迎页</title>
</head>
<body>
<%
    session = request.getSession(false);
    String username = session != null ? (String) session.getAttribute("user") : null;
%>
<h1>欢迎您，<%= username == null ? "访客" : username %>
</h1>
<% if (username != null) { %>
<a href="/logout">退出登录</a>
<% } else { %>
<a href="/login.jsp">返回登录</a>
<% } %>
</body>
</html>